package org.joe.chinachess.core.rules;

import org.joe.chinachess.core.ChessBoard;
import org.joe.chinachess.utils.Point;

/**
 * 定义棋子的规则
 *
 * @author Joe
 */
public interface ChessRule {

    /**
     * 判断src能否吃掉dest
     *
     * @param source 起点
     * @param dest 终点
     * @param chessboard 当前棋盘布局
     * @return
     */
    boolean isCanEat(Point source, Point dest, ChessBoard chessboard) throws Exception;

    /**
     * 是否可以移动
     * @param source 起点
     * @param dest 终点
     * @param chessboard 当前棋盘布局
     * @return
     * @throws Exception
     */
    boolean isCanMove(Point source, Point dest, ChessBoard chessboard) throws Exception;

}
